<template>
  <div class="app-container calendar-list-container">
      <el-form>
      <el-form-item label="地址连接">
      <el-input v-model="query.parameter" placeholder="请设置地址"></el-input>
      </el-form-item>
      </el-form>
      <el-button type="primary" style="margin-top:40px" :loading="loading.edit" @click="updateParameter" >确定</el-button>
  </div>
</template>

<script>
import { VueEditor } from 'vue2-editor'
import { updateSystemParamter,getSystemParamter } from '@/api/system'
export default {
  name: 'system_address',
  data () {
    return {
      loading: {
        edit: false
      },
      query: {
        systemType: 7,
        parameter: ''
      }
    }
  },
  components:{
    VueEditor
  },
  methods: {
    // 获取商城地址
    async getParameter(){
      const { data } = await getSystemParamter({
        systemType:7,
      })
      this.query.parameter = data.parameter
    },
    
    //修改商城地址
    async updateParameter(){
      if(!this.query.parameter){
        this.$message.error('请输入内容');
        return
      }
      const { data } = await updateSystemParamter({
        systemType:7,
        parameter:this.query.parameter
      })
      this.$message.success('修改成功')
    }

  },
  created(){
    this.getParameter();
  }
}
</script>

<style>

</style>
